<template>
  <view class="min-h-screen bg-gray-50 pb-8">
    <!-- <healthCard /> -->
    <!-- <part01 /> -->
    <draw />
    <!-- <role /> -->
    <cir />
    <part0 />
    <!-- <part2 /> -->
    <care />
    <part3 />

    <view class="w-full max-w-[750rpx] mx-auto mt-[30rpx]" @click="handleClick">
      <image src="@/assets/imgs/ehr.png" mode="widthFix" class="w-full" />
    </view>

    <part4 />

    <!-- <part5 :hasPrice="false" /> -->

    <!-- 手动记录数据弹出框 -->
    <!-- <HospitalSelectorExample /> -->
    <!-- <HospitalDepartmentProjectSelectorExample /> -->
    <record />
    <!-- <ThreeLevelDirectoryExample /> -->
  </view>
</template>

<script setup lang="ts">
import Taro from "@tarojs/taro";
import part0 from "./components/part0.vue";
// import part1 from './components/part1.vue'
import part2 from "./components/part2.vue";
import part3 from "./components/part3.vue";
import part4 from "./components/part4.vue";
import draw from "./components/draw.vue";
import care from "@/components/basic-comm/care.vue";
// import role from './components/role.vue'
import cir from "./components/cir.vue";
import HospitalSelectorExample from "@/components/HospitalSelectorExample.vue";
import HospitalDepartmentProjectSelectorExample from "@/components/HospitalDepartmentProjectSelectorExample.vue";
import ThreeLevelDirectoryExample from "@/components/ThreeLevelDirectoryExample.vue";

// import healthCard from '@/pages/index/components/healthCard.vue'
// import part5 from '@/package/goodsdetail/part5.vue'
import record from "./record.vue";
import { request } from "@/service/request";
import { onMounted } from "vue";

onMounted(async () => {
  
});

function handleClick() {
  Taro.navigateTo({
    url: "/pages/historys/past-medical/add?now=1",
  });
}

async function getHospitalList() {
  const res = await request.get(
    "/nurse_hospital/nurseHospital/loadTreeChildren?pid=0",
    {},
    {
      useErrMsg: true,
    }
  );
  console.log("res 医院", res);
  return (
    res.success || [
      {
        key: "1903976907498213377",
        title: "南宁市邕宁区人民医院",
        value: null,
        parentId: "0",
        children: null,
        leaf: true,
      },
    ]
  );
}

async function getDeptList(hospitalId) {
  const res = await request.get(
    "/nurse_dept/nurseDept/loadTreeChildrenByHisid?pid=0&hospitalId=" + hospitalId,
    {},
    {
      useErrMsg: true,
    }
  );
  console.log("res 科室", res);
  return (
    res.success || [
      {
        key: "1902262229508272129",
        leaf: true,
        parentId: "0",
        title: "护理科",
      },
    ]
  );
}

async function getBedList(deptId) {
  const res = await request.get(
    "/nurse_bed/nurseBed/queryByDeptId?deptId=" + deptId,
    {},
    {
      useErrMsg: true,
    }
  );
  console.log("res 床位", res);
  return (
    res.success || [
      {
        code: "HL001",
        deptId: "1902262229508272129",
        id: "1902262323662008322",
        name: "护理001",
      },
    ]
  );
}
</script>
